package cn.juque.systemservice.service.provider;

import cn.juque.common.abstracts.AbstractRequestDTO;
import cn.juque.common.annotation.HandlerAppException;
import cn.juque.common.base.BaseResponseDTO;
import cn.juque.common.constants.MessageEnum;
import cn.juque.systemservice.api.provider.IUserInfoProvider;
import cn.juque.systemservice.service.IUserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author JUQUE
 * @version 1.0.0
 * <ul>
 *  <li>simple-generator</li>
 *  <li>用户信息</li>
 * </ul>
 * @date 2022-11-30 21:47:58
 **/
@Slf4j
@Service("userInfoProvider")
@HandlerAppException
public class UserInfoProviderImpl implements IUserInfoProvider {

    @Resource
    private IUserInfoService userInfoService;

    /**
     * 创建userId
     *
     * @param req 入参
     * @return Boolean
     */
    @Override
    public BaseResponseDTO<String> createUserId(AbstractRequestDTO req) {
        String userId = this.userInfoService.saveInfo();
        return new BaseResponseDTO<>(MessageEnum.OK, userId);
    }
}
